#ifndef __STDSQLITE_H_
#define __STDSQLITE_H_

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include<signal.h>
#include <string.h>
#include <sqlite3.h>

struct StdSqlite;
typedef struct StdSqlite Sql;

Sql* InitSqlite(const char* filename);
void CreateTable(Sql* s, const char* TableName,char** PropertyList,int row);
void InsertData(Sql* s,const char* TableName,char** values,int num);
void UpdateData(Sql *s,const char *TableName,const char* UpdateStr,const char* where);
void DeleteData(Sql* s,const char*TableName,const char* where);


void GetAllFromTable(Sql *s ,const char* TableName,char*** result,int* row,int* column);
char* GetIDFromTableINRes(Sql *s, const char *TableName,char* Name,char* passwd );

int ConfirmById(Sql* s,const char *TableName,const char* id,const char* Name,const char* passwd );

void FreeResult(Sql* s,char** result);
int GetTableLen(Sql* s,const char* TableName);

#endif